<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('员工离职历史')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
    <th:block th:include="include :: container-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    .fixed-table-container .bs-checkbox .th-inner {
        padding: 8px 8px !important;
    }

</style>
<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">员工离职历史</h4>
            </div>
            <div class="modal-body">
                <p>
                    离职日期从:
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" id="BeginDate" class="form-control laydate-demo-2" placeholder="yyyy-MM-dd">
                </div>
                </p>
                <p>
                    离职日期到:
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" id="EndDate" class="form-control laydate-demo-1" placeholder="yyyy-MM-dd">
                </div>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" id="close" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="getData()">确定</button>
            </div>
        </div>
    </div>
</div>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>工号：</p>
                            <input type="text" name="badge"/>
                        </li>
                        <li>
                            <p>姓名：</p>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: hr-help-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "quitManage/quitEmpRegister";
    $(function () {
        $("#myModal1").modal('show');
        $(".datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });

        });
        $(".datetimepicker-demo-1").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });

        });
    });

    function getData() {
        var beginDate = $("#BeginDate").val();
        var endDate = $("#EndDate").val();
        var columns = [];
        var id = {field: 'id', title: '序号'};
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var compName = {field: 'compName', title: '公司名称'};
        var depName = {field: 'depName', title: '部门名称'};
        var jobName = {field: 'jobName', title: '工作岗位'};
        var JobGradeTitle = {field: 'JobGradeTitle', title: '岗位级别'};
        var JoinDate = {field: 'JoinDate', title: '入职日期'};
        var JoinTypeTitle = {field: 'JoinTypeTitle', title: '入职渠道'};
        var ApplyDate = {field: 'ApplyDate', title: '申请离职日期'};
        var LeaveDate = {field: 'LeaveDate', title: '实际离职日期'};
        var LeaveTypeTitle = {field: 'LeaveTypeTitle', title: '离职类型'};
        var LeaveReasonTitle = {field: 'LeaveReasonTitle', title: '离职原因'};
        var lzyy = {field: 'lzyy', title: '离职详因'};
        var isEndCon = {field: 'isEndCon', title: '同步解除合同?'};
        var isPay = {field: 'isPay', title: '支付违约金?'};
        var PayFee = {field: 'PayFee', title: '违约金'};
        var IsExpenses = {field: 'IsExpenses', title: '支付经济补偿金?'};
        var ExpenseFee = {field: 'ExpenseFee', title: '经济补偿金'};
        var Iscompete = {field: 'Iscompete', title: '是否竞业限制?'};
        var competeFee = {field: 'competeFee', title: '竞业限制金'};
        var isBlackList = {field: 'isBlackList', title: '是否黑名单?'};
        var Remark = {field: 'Remark', title: '备注'};
        var RegByName = {field: 'RegByName', title: '登记人'};
        var RegDate = {field: 'RegDate', title: '登记时间'};
        var Initialized = {field: 'Initialized', title: '?确认'};
        var InitializedByName = {field: 'InitializedByName', title: '确认人'};
        var InitializedTime = {field: 'InitializedTime', title: '确认时间'};


        columns.push(id,badge,name,compName,depName,jobName,JobGradeTitle,JoinDate,JoinTypeTitle);
        columns.push(ApplyDate,LeaveDate,LeaveTypeTitle,LeaveReasonTitle,lzyy,isEndCon,isPay,PayFee);
        columns.push(IsExpenses,ExpenseFee,Iscompete,competeFee,isBlackList,Remark,RegByName,RegDate);
        columns.push(Initialized,InitializedByName,InitializedTime);


        $("#close").click();
        var options = {
            url: prefix + "/quitEmpHistory?beginDate=" + beginDate + "&endDate=" + endDate,
            height: $(window).height() - 120,
            modalName: "员工离职历史",
            columns: columns
        };
        $.table.init(options);
    }


</script>
</body>
</html>